#include "stdio.h"
#include "string.h"
int k,ss[400],n,n2;
char in[400],out[400],zhan[400];
int p[3];
			
void print()
{
	int i;
	for (i=1;i<n2;++i) 
		switch (ss[i])
		{
			case 1:printf("i ");break;
			case 2:printf("o ");break;
			default:printf("Error print function.\n");
		}
	printf("o \n");
}

int check()
{
	int i,j,pin=0,pout=0,pzhan=0;
	
	memset(zhan,0,sizeof(zhan));
	for (i=1;i<=n2;++i)
	{
		if (ss[i]==1)
		{
			zhan[pzhan]=in[pin];
			++pin;
			if (pin>n) return 0;
			++pzhan;	
		}
		else 
		{
			if (pzhan==0) return 0;
			if (zhan[pzhan-1]!=out[pout]) return 0;
			--pzhan;
			++pout;
			
		}	
	}	
	return 1;
	
}

main()
{
	int i,j,len1,len2;
	while (scanf("%s",in)!=EOF)
	{
		memset(ss,0,sizeof(ss));
		memset(out,0,sizeof(out));
	        memset(zhan,0,sizeof(zhan));
		memset(p,0,sizeof(p));	
		
		scanf("%s",out);
		len1=strlen(in);
		len2=strlen(out);
		if (len1!=len2)
		{
			printf("[\n]\n");
			continue;
		}	
		n=len1;
		n2=n*2;	
		ss[1]=1;ss[2]=0;   
		k=2;p[1]=1;
		printf("[\n");
		while (k>=2)
		{
			++ss[k];
			if ((k>=n2))
			{
				ss[k]=2;
				if ( (check()==1) ) print();
				--k;
				--p[ss[k]];	
			}
			else if (ss[k]>2)
			{
				--k;
				--p[ss[k]];	
			}
			else 
			{
				++p[ss[k]];
				++k;	
				ss[k]=0;
			}
		}
		printf("]\n");	
		
		memset(in,0,sizeof(in));
	}
}
